#!/bin/sh

GENDIR=$(cd `dirname $0`;pwd)

cd $OX_HOME/workspace/OpenXavaTemplate
ant -f CreateNewProject.xml -Dproject=sistema_oficial

cp $MP_HOME/target/mp-openxava/*.jar $OX_HOME/workspace/sistema_oficial/web/WEB-INF/lib
cd $GENDIR
cp -R * ${OX_HOME}/workspace/sistema_oficial 

cp other/tomcat/snippet/context.xml $OX_HOME/tomcat/conf

cp $MP_HOME/application/lib/extra/*.jar $OX_HOME/tomcat/lib

cd $OX_HOME/tomcat/bin
./startup.sh

cd $OX_HOME/workspace/sistema_oficial
ant -f mp4openxava-build.xml
ant

cd $OX_HOME/workspace/sistema_oficial
ant generatePortlets

firefox http://localhost:8080/sistema_oficial/xava/homeMenu.jsp

cd $GENDIR
